/*
This file is part of TGames.Bonapart(c)2010 , for future releases contact by xmpp://bonapart@qip.ru


    TGames is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    TGames is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with TGames.  If not, see <http://www.gnu.org/licenses/>.
  */
#define anim 1

#ifndef NUMBERSAROUND_H
#define NUMBERSAROUND_H
#include <QtGui>

class NumbersAround : public QDialog
{
    Q_OBJECT

public:
    NumbersAround(QWidget *parent = 0);
    ~NumbersAround();

    // config vars
    // size of each block
    int sh,sw;
    // First block spacing
    int tw,th;
    // first dificult slider
    int difficult;
    // Max number\ 10 is max
    // The second=) logariphmic
    int diff2;

    // flag to count center number
    bool ccont;
    int score;
    int rules;
    int speed;
    int free;
    bool hardcore;
    // JUST SOME INITIALISATION
    void init();
private:
    QRadialGradient gradient;

    double gradt;
    QTime stt;
    int pcx;
    // 100x100 is Absolute maximum
    // 1600x1200 is max resolution
    // so every rectangle will be 1.6px x 1.2px
    // work size contain in vars
    int field[100][100];
    // blocks count
    int h, w;
    // colors for each number
    //Just a array for colors
    QColor clrs[11];
    // var for current competition
    int curt;
    // function for curt generation , Cpt.Obv.
    int generatecurt(int lk=0);

    void gameover();
    bool clickat(int,int);
    void rejectcurt();
private slots:
    #ifdef anim
    void grad();
#endif
    void tout();
protected:

    void paintEvent ( QPaintEvent * ) ;
    void mouseReleaseEvent ( QMouseEvent *) ;
};

#endif // NUMBERSAROUND_H
